﻿<?xml version="1.0" encoding="utf-8"?>



<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output method="xml" indent="yes"/>



	<xsl:template match="googletrends">

		<xsl:element name="googletrends">

			<xsl:apply-templates select="trend">
        <xsl:sort select="@lastseen" order="descending"/>
        <xsl:sort select="@timesseen" order="descending"/>
      </xsl:apply-templates>

		</xsl:element>

	</xsl:template>



	<xsl:template match="trend">

		<xsl:copy-of select="."/>

	</xsl:template>



</xsl:stylesheet>